package com.example.springbootorderrabbitmqconsoumer.service.topic;

import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.*;
import org.springframework.stereotype.Service;

@Service
@RabbitListener(bindings = @QueueBinding(
        exchange = @Exchange(value = "topic-order-exchange",type = ExchangeTypes.TOPIC),
        value = @Queue(value = "email-topic-queue",durable = "true",autoDelete = "false"),
        key = "*.email.#"
))
public class EmailTopicConsumer {

    @RabbitHandler
    public void receiveMessage(String msg) {
        System.out.println("email-topic-queue 收到消息：" + msg);
    }
}
